Skip to content

Conversation

@bonzini
Copy link
Collaborator

@bonzini bonzini commented Jan 20, 2026

With clang exists in the system path and cl does not, meson generates build.ninja file using clang as linker even for -msvc targets. Look at the target, and detect the correct C/C++ compiler based on whether it is a MSVC target.

Fixes: #6638

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
With clang exists in the system path and cl does not, meson generates
build.ninja file using clang as linker even for -msvc targets.  Look at
the target, detect the correct C/C++ compiler based on whether it
is a MSVC target, and then use cc.linker as the linker for Rust.

Fixes: mesonbuild#6638
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
@bonzini bonzini marked this pull request as ready for review January 28, 2026 09:55
@bonzini bonzini added bug OS:windows Winodows OS specific issues language:rust labels Jan 28, 2026
@dcbaker dcbaker merged commit a7f4d42 into mesonbuild:master Jan 28, 2026
31 checks passed
@bonzini bonzini deleted the fix6638 branch January 29, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug language:rust OS:windows Winodows OS specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rust linker problem on windows when clang is present

3 participants